package xin.vsftpd.Config;

import xin.vsftpd.BootStrap;

import java.io.IOException;
import java.util.Properties;

/**
 * <pre>
 * 环境配置信息
 * </pre>
 * @version 1.0
 * @author lixin_ma@outlook.com
 * @since 2019/7/9
 */
public class Env {
	private static Properties config = new Properties();
	static {
		init();
	}
	
	public static Object get(String key){
		return config.getProperty(key);
	}
	
	public static Object get(String key,String defaultValue){
		return config.getProperty(key,defaultValue);
	}
	
	private static void init(){
		try {
			config.load(BootStrap.class.getResourceAsStream("/ini.properties"));
		} catch (IOException e) {
			System.out.println("加载配置文件失败");
		}
	}
}
